{include file="public/hunanconstr_meta" /}
<link href="__PUBLIC_ADMIN__css/plugins/footable/footable.core.css" rel="stylesheet">
<link href="__PUBLIC_ADMIN__js/plugins/fancybox/jquery.fancybox.css" rel="stylesheet">
<style>
#huiedit{
	background-color: #1ab394;
	color: #FFFFFF;
}
#huidel{
	background-color: #ed5565;
	color: #FFFFFF;
}
#hui{
	 width: 50px;
        height: 50px;
}

</style>
</head>

<body class="gray-bg">
   <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>所有项目</h5>
                        <div class="ibox-tools">
                            <a href="{:url('admin/Hunanconstr/project_add')}" class="btn btn-primary btn-xs">创建新项目</a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="row m-b-sm m-t-sm">
                            <div class="col-md-1">
                                <button type="button" id="loading-example-btn" class="btn btn-white btn-sm refresh"><i class="fa fa-refresh"></i> 刷新</button>
                            </div>
                            <div class="col-md-11">
                            	<form action="{:url('admin/Hunanconstr/ProjectSearch')}" method="post" class="form-horizontal" enctype="multipart/form-data">
                                <div class="input-group">
                                    <input placeholder="请输入企业名称" class="input-sm form-control" type="text" name="search"> <span class="input-group-btn">
                                        <button type="button" class="btn btn-sm btn-primary"> 搜索</button> </span>
                                </div>
                                </form>
                            </div>
                        </div>

						<table class="footable  table table-stripped toggle-arrow-tiny" data-page-size="50" data-filter=#filter>
                            <thead>
                                    <tr>
                                        <th width="70">项目ID</th>
                                        <th width="250">项目名称<span style="color:red">[{$arr.number}]个</span></th>
                                        <th width="130">工程造价<span style="color:red">[{$arr.plan_output_total}]万</span></th>
                                        <th width="130">建设面积<span style="color:red">[{$arr.total_area}]m²</span></th>
                                        <th width="100">建造记录</th>
                                        <th width="100">大事记</th>
                                        <th width="100">项目状态</th>
                                        <th width="100">审核状态</th>
                                        <th width="150">操作</th>
                                        <th data-hide="all">项目编号</td>
                                        <th data-hide="all">创建用户ID</td>
                                        <th data-hide="all">公司ID</td>
                                        <th data-hide="all">公司名称</td>
                                        <th data-hide="all">模型图</td>
                                    </tr>
                                </thead>
                                <tbody>
                                	{foreach name="res" id="vo" key="key"}
                                    <tr class="gradeX">
										<td>{$vo.id}</td>
										<td>{$vo.project_name|mb_substr=0,30,'utf-8'}...</td>
										<td>{$vo.plan_output_total}万</td>
										<td>{$vo.total_area}m²</td>
										<td>
										 <a href="{:url('admin/Hunanconstr/framed_Data',['id'=>$vo.id])}" id="huidel" ><span class="label label-primary">建造记录</span></a>
										</td>
										<td>
										 <a href="{:url('admin/Hunanconstr/memorabilia',['id'=>$vo.id])}" id="huidel" ><span class="label label-primary">大事记</span></a>
										</td>
                                        <td>
                                        {if condition="$vo.project_status eq 1"}
                                        <span class="label label-primary">进行中
                                        {elseif condition="$vo.project_status eq 0"}
                                        <span class="label label-default">滞后中
                                        {elseif condition="$vo.project_status eq 2"}
                                        <span class="label label-primary">已完成
                                        {/if}
                                        </td>
                                        <td>
                                        {if condition="$vo.review_status eq 0"}
                                        <a href="{:url('admin/Hunanconstr/examine',['id'=>$vo.id,'type'=>1])}" id="huidel" ><span class="label label-default">未审核</span></a>
                                        {elseif condition="$vo.review_status eq 1"}
                                        <a href="{:url('admin/Hunanconstr/examine',['id'=>$vo.id,'type'=>2])}" id="huidel" ><span class="label label-primary">已通过</span></a>
                                        {elseif condition="$vo.review_status eq 2"}
                                        <a href="{:url('admin/Hunanconstr/examine',['id'=>$vo.id,'type'=>0])}" id="huidel" ><span class="label label-defaults">已失败</span></a>
                                        {/if}
                                        </td>
										<td>
										{if condition="$vo.review_status eq 1"}
										<a href="{:url('admin/Hunanconstr/project_cat_list',['id'=>$vo.id])}" id="huiedit" class="btn btn-white btn-sm edit">查看 </a>
										{else}
										{/if}
                                        <a href="{:url('admin/Hunanconstr/project_edit',['id'=>$vo.id])}" id="huiedit" class="btn btn-white btn-sm edit">编辑 </a>
                                        {if condition="$vo.state eq 0"}
                                        <a href="{:url('admin/Hunanconstr/project_del',['id'=>$vo.id,'type'=>1])}" id="huidel" class="btn btn-white btn-sm edit">禁用</a>
                                        {else}
                                        <a href="{:url('admin/Hunanconstr/project_del',['id'=>$vo.id,'type'=>0])}" id="huiedit" class="btn btn-white btn-sm edit">启用</a>
                                        {/if}
                                        </td>
                                        <td>{$vo.project_no}</td>
                                        <td>{$vo.add_uid}</td>
                                        <td>{$vo.company_id}</td>
                                        <td>{$vo.item_name}</td>
                                        <td>
                                            <div class="ibox-content">
                                                <a class="fancybox" href="{$vo.project_model}" title="">
                                                    <img alt="image" class="img"  src="{$vo.project_model}" style="width:100px">
                                                </a>
                                            </div>  
                                        </td>
                                    </tr>  
                                    {/foreach}  
                                </tbody>
                                <tfoot hidden="hidden">
                                    <tr>
                                        <td colspan="5">
                                            <ul class="pagination pull-right"></ul>
                                        </td>
                                    </tr>
                                </tfoot>   
                        </table>
                        <div class="item-page" style="padding-left:600px;">
                       
						</div> 
                    </div>
                </div>
            </div>
        </div>
    </div>
        
    {include file="public/hunanconstr_footer" /}
	<script src="__PUBLIC_ADMIN__js/plugins/footable/footable.all.min.js"></script>
	
    <!-- Fancy box -->
    <script src="__PUBLIC_ADMIN__js/plugins/fancybox/jquery.fancybox.js"></script>   
    <script>
        $(document).ready(function () {
            $('.fancybox').fancybox({
                openEffect: 'none',
                closeEffect: 'none'
            });
        });
    </script>  

    <!-- 自定义js -->
    <script src="__PUBLIC_ADMIN__js/content.js?v=1.0.0"></script>
    <script>
        $(document).ready(function() {
            $('.footable').footable();
            $('.footable2').footable();
			
            $('.refresh').click(function(){
            	window.location.reload();	// 刷新页面
            })
            
          	//iframe窗
          	$('.edit').click(function(){
          		var index = layer.open({
          			type : 2,
					fixed: true,
					scrollbar: false,
					title : '编辑',
					shadeClose : false,
					maxmin : true, //开启最大化最小化按钮
					area : ['893px', '600px'],
					//offset: '100px',
					content : '{:url("admin/admin/edit")}'
          		});
          		layer.full(index);
          	})
		});
	</script>
</body>
</html>
